﻿using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace DrivingGame
{
    class Player : Car
    {
        public Player()
        {
            this.topSpeeds = new float[5] { 0.0f, 7.0f, 14.0f, 21.0f, 28.0f };
            this.accelerations = new float[5] { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f };
        }

        public void ProcessKeyboard(GameTime gameTime)
        {
            KeyboardState keys = Keyboard.GetState();
            if (keys.IsKeyDown(Keys.Up))
                Accelerate();
            else if (keys.IsKeyDown(Keys.Down))
                Brake();
            else
                Free();

            if (keys.IsKeyDown(Keys.Left))
                Left();
            else if (keys.IsKeyDown(Keys.Right))
                Right();
            else
                NoTurn();
        }
    }
}
